<?php

class Module_Admin_Grid_User extends Engine_Form_Grid {

    public function init() {

        $this->addColumn(new Engine_Grid_Column(array(
            'name' => 'Имя',
            'field' => 'name',
        )));

        $this->addColumn(new Engine_Grid_Column(array(
            'name' => 'Логин',
            'field' => 'login',
        )));

        $this->addColumn(new Engine_Grid_Column(array(
            'name' => 'Права',
            'field' => 'role',
        )));

        $this->initUserActions();
    }

    public function initUserActions() {

        $this->addAction(new Engine_Grid_Action(array(
            'name' => 'Профиль',
            'href' => '/admin/catalog/userProfile/id/%id%/',
        )));

        $this->addAction(new Engine_Grid_Action(array(
            'name' => 'Изменить',
            'href' => '/admin/catalog/edituser/id/%id%/',
        )));

        $this->addAction(new Engine_Grid_Action(array(
            'name' => 'Удалить',
            'href' => '/admin/catalog/deleteuser/id/%id%/',
        )));

    }
}